@import "../common/variables";
@import "../common/mixins";

.m-checkbox {
  display: inline-block;
  padding-right: 10px;
  > .checkbox-icon {
    border: 1px solid #CCC;
    border-radius: 2px;
    display: inline-block;
    position: relative;
    z-index: 10;
    vertical-align: bottom;
    pointer-events: none;
    > i {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      border: 2px solid #FFF;
      border-top: 0;
      border-left: 0;
      transform: translate(-50%, -50%) rotate(45deg) scale(0);
      margin-top: -10%;
    }
  }
  > .checkbox-text {
    margin-left: 1px;
    font-size: 15px;
    color: #666;
    pointer-events: none;
  }
  > input[type="checkbox"] {
    position: absolute;
    left: -9999em;
    &:checked + .checkbox-icon {
      background-color: currentColor;
      border-color: currentColor;
      > i {
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
        transition: all .2s ease-in-out;
      }
    }
    &:disabled ~ .checkbox-text {
      color: #CCC;
    }
    &:disabled + .checkbox-icon {
      border-color: #CCC;
      background-color: #F3F3F3;
      > i {
        border-color: #CCC;
      }
    }
  }
}
